﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TouchSocket.Core;
using TouchSocket.Sockets;

namespace Teriri.File.Server.TcpPlugin
{
    /// <summary>
    /// 连接处理插件
    /// </summary>
    public class TcpConnectPlugin : PluginBase, ITcpConnectedPlugin, ITcpConnectingPlugin
    {
        public Task OnTcpConnecting(ITcpClientBase client, ConnectingEventArgs e)
        {
            LoggerHelper.Log<TcpConnectPlugin>($"客户端（{client.IP}）请求连接");
            return Task.CompletedTask;
        }

        public Task OnTcpConnected(ITcpClientBase client, ConnectedEventArgs e)
        {
            LoggerHelper.Log<TcpConnectPlugin>($"客户端（{client.IP}）连接成功");
            return Task.CompletedTask;
        }
    }
}
